Component({
  properties: {
    name: {
      type: String,
      value: '名字'
    },
    couponList:{
      type: Array,
      value:[]
    },
    canCheck:{
      type:Boolean,
      value: false
    }
  },
  data: {
    // 组件内部数据
    radioItems: [{
        name: 'cell standard',
        value: '0'
      },
      {
        name: 'cell standard',
        value: '1',
        checked: true
      }
    ],
    activeIndex:''
  },
  methods: {

    /* 选择优惠券 */
    SelectCoupon: function (e) {
      if(this.properties.canCheck){
        this.setData({
          activeIndex: e.currentTarget.dataset.index
        })
        var count = this.properties.couponList[e.currentTarget.dataset.index].count  
        var coupId = this.properties.couponList[e.currentTarget.dataset.index].id
        var minAmount = this.properties.couponList[e.currentTarget.dataset.index].minAmount+'' || 0
        var maxAmount = this.properties.couponList[e.currentTarget.dataset.index].maxAmount+''
        var disType = this.properties.couponList[e.currentTarget.dataset.index].disType
        wx.setStorageSync('couponDiscount', count);
        wx.setStorageSync('minAmount', minAmount);
        wx.setStorageSync('maxAmount', maxAmount);
        wx.setStorageSync('coupId', coupId);
        wx.setStorageSync('disType', disType);
      }
     
    }
  }
})